//增加子区域
// regionItem 是一个JSON对象{id,itemId,itemFullName}
function addRegionItem(regionItem){
	var id,itemId,itemFullName;
	if(null == regionItem.id){
		id = "";		
	}else{
		id = regionItem.id;
	}
	itemId = regionItem.itemId;
	itemFullName = regionItem.itemFullName;
	var html="";
	html += '<tr height="50" class="reigonItemClass" id="reigonItem'+id+'">';
	html += '<td>'+itemFullName+'</td>';
	html += '<td>';
	html += '<a href="javascript:void(0)" onclick="deleteRegionItem(this)" class="del"></a>';
	html += '</td><td></td>';
	
	//start:hidden
	html += '<input type="hidden" name="regionItemIds"  value="'+id+'"/>';
	html += '<input type="hidden" name="itemIds"  value="'+itemId+'"/>';
	//end:hidden
	html += '</tr>';
	$j('#regionItemTable').append(html);
	
	
}


//删除子区域
//linkDOM 是一个超链接对象
function deleteRegionItem(linkDOM){
	if(confirm(__FMT.regionItemDetail_delete_confirm)){
		$j(linkDOM).parents('tr.reigonItemClass').remove();
	}	
}

//显示地区选择器
function showRegionSelector(){
	showDialogOfregionSelector();
}

//显示地区选择器后的callback
function selectorRegion(region){
	addRegionItem({id:null,itemId:region.id,itemFullName:region.fullName});
	closeDialogOfregionSelector();
}